/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Andrés Felipe
 */
public class Supplier implements Serializable {
    private static final long serialVersionUID = 1L;
    private Integer identification;
    private String name;
    private String address;
    private String phone;
    private String email;
    private Pyme pymeidentification;
    private List<SupplierXproduct> supplierXproductList;

    public Supplier() {
    }

    public Supplier(Integer identification) {
        this.identification = identification;
    }

    public Supplier(Integer identification, String name, String address, String phone, String email) {
        this.identification = identification;
        this.name = name;
        this.address = address;
        this.phone = phone;
        this.email = email;
    }

    public Integer getIdentification() {
        return identification;
    }

    public void setIdentification(Integer identification) {
        this.identification = identification;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Pyme getPymeidentification() {
        return pymeidentification;
    }

    public void setPymeidentification(Pyme pymeidentification) {
        this.pymeidentification = pymeidentification;
    }

    @XmlTransient
    public List<SupplierXproduct> getSupplierXproductList() {
        return supplierXproductList;
    }

    public void setSupplierXproductList(List<SupplierXproduct> supplierXproductList) {
        this.supplierXproductList = supplierXproductList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (identification != null ? identification.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Supplier)) {
            return false;
        }
        Supplier other = (Supplier) object;
        if ((this.identification == null && other.identification != null) || (this.identification != null && !this.identification.equals(other.identification))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Supplier[ identification=" + identification + " ]";
    }
    
}
